// 获取url？后面的参数

var id = GetRequest();

function GetRequest() {
    var url = location.search; //获取url中"?"符后的字串  
    var theRequest = new Object();
    if (url.indexOf("?") != -1) {
        var str = url.substr(1);
        strs = str.split("&");
        for (var i = 0; i < strs.length; i++) {
            theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
        }
    }
    return theRequest;
}

// 渲染打折商品
$.get("http://193.112.55.79:9090/api/getinlanddiscount", {
    // "productId": productId
    "productId": id.productId
}, function (res) {
    console.log(res);

    var html = template("rebateTem", {
        arr: res.result
    });
    console.log(html);

    $('.rebate_main').html(html);

})